package oop.ex3.crosswords;

/**
 * File name: MyCrosswordEntry.java
 * Description: A crossword entry is a word at a given position in a crossword.
 * @author yossavi dawn16889
 */
public class MyCrosswordEntry implements CrosswordEntry {
	
	private CrosswordPosition position;
	private String definition;
	private String term;
	
	
	/**
	 * constructor
	 * @param position - the word's position
	 * @param definition - the term's definition
	 * @param term - the word
	 */
	public MyCrosswordEntry(CrosswordPosition position, String definition,String term) {
		this.position = position;
		this.definition = definition;
		this.term = term;
		
	}
	
	/* (non-Javadoc)
	 * @see oop.ex3.crosswords.CrosswordEntry#getPosition()
	 */
	@Override
	public CrosswordPosition getPosition() {
		return this.position;
	}

	/* (non-Javadoc)
	 * @see oop.ex3.crosswords.CrosswordEntry#getDefinition()
	 */
	@Override
	public String getDefinition() {
		return this.definition;
	}

	/* (non-Javadoc)
	 * @see oop.ex3.crosswords.CrosswordEntry#getTerm()
	 */
	@Override
	public String getTerm() {
		return this.term;
	}

	/* (non-Javadoc)
	 * @see oop.ex3.crosswords.CrosswordEntry#getLength()
	 */
	@Override
	public int getLength() {
		return term.length();
	}
}
